﻿@namespace ERP.Abp.AntDesignUI
@inherits AntDomComponentBase

@if (Pages == null)
{
    
}
else
{
    <Tabs Class="@Class" Style="@Style"  Id="@Id" OnEdit="OnEdit" OnTabClick="OnTabClick" OnChange="OnChange" HideAdd Type="@TabType.EditableCard" @bind-ActiveKey="@CurrentUrl" OnClose="RemovePage" Draggable="Draggable" Size="Size">
        @foreach (var item in Pages)
        {
            <TabPane @key="@item.Url" Key="@item.Url" Class="@TabPaneClass" Closable="item.Closable" ForceRender>
                <TabTemplate>
                    @item.Title
                </TabTemplate>
                <ChildContent>
                    @Body(item)
                </ChildContent>
                <TabContextMenu>
                    <Menu>
                        <MenuItem Disabled="!item.Closable" OnClick="@(()=>{RemovePage(item.Url);})">关闭</MenuItem>
                        <MenuItem OnClick="RemoveAll">关闭所有</MenuItem>
                        <MenuItem OnClick="@(()=>{ RemoveOther(item.Url);})">关闭其他</MenuItem>
                        @*         <MenuDivider />
                            <MenuItem>@Locale.PinTab</MenuItem>*@
                    </Menu>
                </TabContextMenu>
            </TabPane>
        }
    </Tabs>
}